package com.changgou.order.feign;

import com.changgou.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author 20201117
 */
@FeignClient(name = "order")
public interface CartFeign {

    /**
     * 将商品信息，添加 到购物车
     * @param skuId 商品id
     * @param num 商品数量
     * @return
     */
    @GetMapping("/cart/add")
    @ResponseBody
    public Result add(@RequestParam("skuId") String skuId, @RequestParam("num") Integer num);


    /**
     * 查询 用户 购物车信息
     * @return
     */
    @GetMapping("/cart/list")
    @ResponseBody
    public Result<Map> list();

}
